xen/arm, libxl: Implement XEN_DOMCTL_shadow_op for Arm
authorHenry Wang <Henry.Wang@arm.com>
Tue, 11 Oct 2022 12:55:40 +0000 (14:55 +0200)
committerJan Beulich <jbeulich@suse.com>
Tue, 11 Oct 2022 12:55:40 +0000 (14:55 +0200)
commit3a16da801e14b8ff996b6f7408391ce488abd925
tree226d15dcca838f996faeaec4995bd1fe01bd66a5
parent914fc8e8b4cc003e90d51bee0aef54687358530a
xen/arm, libxl: Implement XEN_DOMCTL_shadow_op for Arm

This commit implements the `XEN_DOMCTL_shadow_op` support in Xen
for Arm. The p2m pages pool size for xl guests is supposed to be
determined by `XEN_DOMCTL_shadow_op`. Hence, this commit:

- Introduces a function `p2m_domctl` and implements the subops
`XEN_DOMCTL_SHADOW_OP_SET_ALLOCATION` and
`XEN_DOMCTL_SHADOW_OP_GET_ALLOCATION` of `XEN_DOMCTL_shadow_op`.

- Adds the `XEN_DOMCTL_SHADOW_OP_SET_ALLOCATION` support in libxl.

Therefore enabling the setting of shadow memory pool size
when creating a guest from xl and getting shadow memory pool size
from Xen.

Note that the `XEN_DOMCTL_shadow_op` added in this commit is only
a dummy op, and the functionality of setting/getting p2m memory pool
size for xl guests will be added in following commits.

This is part of CVE-2022-33747 / XSA-409.

Signed-off-by: Henry Wang <Henry.Wang@arm.com>
Reviewed-by: Stefano Stabellini <sstabellini@kernel.org>
master commit: cf2a68d2ffbc3ce95e01449d46180bddb10d24a0
master date: 2022-10-11 14:28:42 +0200
tools/libs/light/libxl_arm.c
xen/arch/arm/domctl.c